#pragma once
#include "afxwin.h"


// CChSMessageParser dialog

class CChSMessageParserDlg : public CDialog
{
	DECLARE_DYNAMIC(CChSMessageParserDlg)

public:
	CChSMessageParserDlg(CWnd* pParent = NULL);
	virtual ~CChSMessageParserDlg();
	enum { IDD = IDD_DIALOG_MESSGAE_PARSER };

	CString FileName() const { return m_strFileName; }
	void FileName(CString val) { m_strFileName = val; }

	static void BeginParsing();

protected:
	virtual void DoDataExchange(CDataExchange* pDX);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual BOOL OnInitDialog();
	virtual void OnOK(){};
	virtual void OnCancel();
	
private:
	void LoadFile();
	void SaveFile(const CString& strFileName);
	void ConstructUsersListFrom(const CString& strMessage);
	void ConstructUsersListTo(const CString& strMessage);
	void ExecuteFilter();
	BOOL ContainFrom(const CString& strMessage);
	BOOL ContainTo(const CString& strMessage);
	CString GetTo(const CString& strMessage);
	CString GetFrom(const CString& strMessage);

private:
	CComboBox	m_cmbUserNamesFrom;
	CComboBox	m_cmbUserNamesTo;
	CListBox	m_lbMessages;

private:
	CString		m_strFileName;
	CStringList m_MsgArr;
	CString		m_strFilterFrom;
	CString		m_strFilterTo;
	UINT		m_uMessagesCount;

protected:
	DECLARE_MESSAGE_MAP()
	afx_msg void OnFileOpen32777();
	afx_msg void OnCbnSelchangeComboUserNamesFrom();
	afx_msg void OnCbnSelchangeComboUserNamesTo();
	afx_msg void OnFileSave32778();
	afx_msg void OnFileExit32776();
};
